﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Core.Master" AutoEventWireup="true"
    CodeBehind="CustomerHistory.aspx.cs" Inherits="Pap.Web.Modules.Loan.Views.CustomerHistory"
    meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        var renderBool = function (value) {
            if (value)
                return '<asp:Literal runat="server" Text="<%$ Resources:BoolTrue%>" />';
            else
                return '<asp:Literal runat="server" Text="<%$ Resources:BoolFalse%>" />';
        }

    </script>
    <ext:Store ID="storeHistory" runat="server" AutoLoad="True" IDMode="Legacy" meta:resourcekey="storeHistoryResource1"
        SerializationMode="Simple">
        <Reader>
            <ext:JsonReader ReaderID="LoanID">
                <Fields>
                    <ext:RecordField Name="CommitteeIDLoanNumber" Type="string" />
                    <ext:RecordField Name="LoanID" />
                    <ext:RecordField Name="LoanNumber" Type="Int" />
                    <ext:RecordField Name="LoanCreatedDate" Type="Date" />
                    <ext:RecordField Name="ProjectName" Type="String" />
                    <ext:RecordField Name="ProjectStage" Type="Int" />
                    <ext:RecordField Name="OldCustomerCode" Type="String" />
                    <ext:RecordField Name="LastConsecutiveDelay" Type="Int" />
                    <ext:RecordField Name="LastDiscreteDelay" Type="Int" />
                    <ext:RecordField Name="PreviousTrials" Type="Boolean" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Direction="ASC"></SortInfo>
    </ext:Store>
    <ext:FitLayout runat="server" ID="fitLayout1" IDMode="Legacy" meta:resourcekey="FitLayoutResource1">
        <ext:FormPanel ID="FormPanel1" runat="server" BodyStyle="padding:5px;" ButtonAlign="Right" 
            meta:resourcekey="FormPanel1Resource1">
            <Body>
                <ext:FormLayout runat="server" ID="frmLayoutErrors" meta:resourcekey="frmLayoutErrorsResource1">
                    <ext:Anchor Horizontal="90%">
                        <ext:Label ID="lblSSID" runat="server" meta:resourcekey="lblSSIDResource1" />
                    </ext:Anchor>
                    <ext:Anchor Horizontal="90%">
                        <ext:Label ID="lblName" runat="server" meta:resourcekey="lblNameResource1" />
                    </ext:Anchor>
                    <ext:Anchor Horizontal="100%">
                        <ext:GridPanel ID="gridLoanHistory" runat="server" StoreID="storeHistory" StripeRows="True"
                            TrackMouseOver="True" AutoExpandColumn="ProjectName" meta:resourcekey="gridLoanHistoryResource1"
                            AutoHeight="true">
                            <SelectionModel>
                                <ext:RowSelectionModel runat="server" SelectedRecordID="LoanID" SingleSelect="true">
                                    <AjaxEvents>
                                        <SelectionChange OnEvent="gridLoanHistory_SelectedChanged" />
                                    </AjaxEvents>
                                </ext:RowSelectionModel>
                            </SelectionModel>
                            <ColumnModel ID="ColumnModel1">
                                <Columns>
                                    <ext:Column Header="<%$ Resources:LoanNumber%>" Sortable="True" DataIndex="LoanNumber"
                                        Hideable="False" />
                                    <ext:Column Header="<%$ Resources:CreationDate%>" Sortable="True" DataIndex="LoanCreatedDate"
                                        Hideable="False">
                                        <Renderer Fn="Ext.util.Format.dateRenderer('m/d/Y')" />
                                    </ext:Column>
                                    <ext:Column ColumnID="ProjectName" Header="<%$ Resources:ProjectName%>" Sortable="True"
                                        DataIndex="ProjectName" Hideable="False" />
                                    <ext:Column Header="<%$ Resources:StageName%>" Sortable="True" DataIndex="ProjectStage"
                                        Hideable="False" />
                                    <ext:Column Header="<%$ Resources:OldCode%>" DataIndex="OldCustomerCode" Hideable="False" />
                                    <ext:Column Header="<%$ Resources:ConsecutiveDelay%>" DataIndex="LastConsecutiveDelay"
                                        Hideable="False" />
                                    <ext:Column Header="<%$ Resources:DiscreteDelay%>" DataIndex="LastDiscreteDelay"
                                        Hideable="False" />
                                    <ext:Column Header="<%$ Resources:PreviousTrials%>" DataIndex="PreviousTrials" Hideable="False">
                                        <Renderer Fn="renderBool" />
                                    </ext:Column>
                                </Columns>
                            </ColumnModel>
                        </ext:GridPanel>
                    </ext:Anchor>
                    <ext:Anchor Horizontal="100%">
                        <ext:TextArea runat="server" ID="txtNotes" FieldLabel="<%$ Resources:txtNotesFieldLabel%>" StyleSpec="margin-top:10px;"
                            ReadOnly="true" />
                    </ext:Anchor>
                </ext:FormLayout>
            </Body>
            <BottomBar>
                <ext:StatusBar ID="statusBar" runat="server">
                    <Items>
                        <ext:Button runat="server" IDMode="Static" ID="btnBack" Text="<%$ Resources:BackButton %>"
                            Icon="ArrowUndo">
                            <AjaxEvents>
                                <Click OnEvent="btnBack_Clicked" />
                            </AjaxEvents>
                        </ext:Button>
                    </Items>
                </ext:StatusBar>
            </BottomBar>
        </ext:FormPanel>
    </ext:FitLayout>
</asp:Content>
